
$(function() {
	var a = $("fieldset[id^='contact']");
	count = a.length + 1;
	for (var i = 1; i < count; i++) {
		z.push(i);
	}

	ContactEdit.refresh();
	
	var _vv_option = {
		rules: {
			name: "required",
			fullname: "required"
		},
		errorPlacement: function(label, element) {
			label.insertAfter(element);
		},
		success: function(label) {
			label.html("&nbsp;").addClass("checked");
		}
	};
	
	validator = $("#form_edit").validate(_vv_option);
	
	$('#continent').selectChain({
		target: $('#country'),
		key: "code",
		value: "name",
		url: 'info.php?do=Country.ajax_continent',
		data: { ajax: false }
	});

	$('textarea').css("width", 400);
	$('#code').css("width", 120);
	$('#name').css("width", 120);
});

function on_job(form) {
	
	var s = form.job_t.value;
	
	$(form.job).val(s);
}

function on_dept(form) {
	
	var s = form.dept_t.value;
	
	$(form.dept).val(s);
}
